package com.kayt.cyberBar.cuser.business.dao.impl;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.kayt.cyberBar.common.dao.EntityDao;
import com.kayt.cyberBar.cuser.business.dao.IExamQuotaDao;
import com.kayt.cyberBar.cuser.business.entity.po.BExamQuota;

@Repository("examQuotaDao")
public class ExamQuotaDaoImpl implements IExamQuotaDao{
	@Autowired
	private EntityDao entityDao;
	@Override
	public void saveOrUpate(BExamQuota entity) throws SQLException {
		if(entity.getId() != null){
			entityDao.update(entity);
		}else{
			entityDao.save(entity);
		}
	}

	@Override
	public BExamQuota findByStoreCode(String storeCode) throws SQLException {
		Object[] param = new Object[]{storeCode};
		return entityDao.getObj(BExamQuota.class, "o.storeCode = ?", param);
	}

}
